﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A84重载练习
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] array = { 2, 3, 1, 6, 0 };
           int max=   Max(array);
            Console.WriteLine(max);
        }
        //整数数组求最大值
        static int Max(int[] array) 
        {
            int max = array[0];
            for (int i = 1; i < array.Length; i++)
            {
                if (array[i]>max)
                {
                    max = array[i];
                }
            }
            return max;
        }
        //浮点数数组求最大值
        static float Max(float[] array)
        {
            float max = array[0];
            for (int i = 1; i < array.Length; i++)
            {
                if (array[i] > max)
                {
                    max = array[i];
                }
            }
            return max;
        }
    }
}
